refactor code in post

Signed-off-by: Ramnique Singh <mail@ramniquesingh.name>