Renamed functions for improved understanding of their function.

Signed-off-by: Lucas Arnström <lucasarnstrom@gmail.com>